package com.baibei.ebec.user.register;

import android.os.Bundle;
import android.support.annotation.Nullable;
import android.view.View;

import com.alibaba.android.arouter.facade.annotation.Route;
import com.baibei.basic.IPresenter;
import com.baibei.ebec.user.R;
import com.baibei.module.AppRouter;
import com.baibei.module.BasicActivity;

/**
 * 注册审核界面
 * Created by ChenRui on 2017/8/3 0003 17:35.
 */
@Route(path = AppRouter.ROUTER_USER_REGISTER_STATUS)
public class RegEnterpriseStatusActivity extends BasicActivity {

    @Override
    protected void onCreate(@Nullable Bundle savedInstanceState) {
        super.onCreate(savedInstanceState);
        // 根据类型来显示布局
        String type = getIntent().getStringExtra("type");

        if ("success".equalsIgnoreCase(type)) {
            // 成功
            setContentView(R.layout.layout_reg_status_waiting, false);
        } else {
            setContentView(R.layout.layout_reg_status_failed, false);
        }

        // 回首页
        findViewById(R.id.btn_finish).setOnClickListener(new View.OnClickListener() {
            @Override
            public void onClick(View view) {
                AppRouter.routeToMain(getContext());
                finish();
            }
        });


        View regView = findViewById(R.id.btn_register);
        if (regView != null) {
            regView.setOnClickListener(new View.OnClickListener() {
                @Override
                public void onClick(View view) {
                    AppRouter.routeToRegister(RegEnterpriseStatusActivity.this, 1);
                    finish();
                }
            });
        }
    }

    @Override
    public IPresenter getBasicPresenter() {
        return null;
    }
}
